import { useUserinfoApi } from "@/api/index";

Page({
  data: {
    tenantList: [],
  },
  onLoad() {
    this.getUserinfo();
  },
  //获取用户信息
  async getUserinfo() {
    let {
      data: { tenantList, wxBind },
    } = await useUserinfoApi();
    this.setData({
      tenantList,
    });
  },
  //进入首页
  enterIndex(e) {
    let tenantId = e.target.dataset.id;
    let tenantName = e.target.dataset.name;
    wx.setStorageSync("tenantCode", tenantId);
    wx.setStorageSync("tenantName", tenantName);
    wx.reLaunch({
      url: `/pages/home/index/index?id=${tenantId}&name=${tenantName}`,
    });
  },
});
